package com.all.learning.guava.other;


import java.util.List;
import java.util.Map;

import org.junit.Test;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Ordering;
import com.google.common.primitives.Ints;

public class GGorder {

	@Test
	public void testOrder() {
		Ordering<String> byLengthOrdering = new Ordering<String>() {
			public int compare(String left, String right) {
				return Ints.compare(left.length(), right.length());
			}
		};
		List<String> lists = Lists.newArrayList("cbc", "a", "bcd");
		List<String> orderList = Ordering.natural().sortedCopy(lists);
		System.out.println(orderList);
		System.out.println(byLengthOrdering.sortedCopy(lists));
		Map<String,String> map = Maps.newHashMap();
	}
}
